//
// Created by dgy on 2022/11/11.
//

#ifndef LEETCODE_COMMON_H
#define LEETCODE_COMMON_H

#endif //LEETCODE_COMMON_H
#ifndef _COMMON_H_
#define _COMMON_H_

#include <stdio.h>
#include <time.h>
#include <stdlib.h>

#define DEBUG
#ifdef DEBUG
#define DBGP fprintf
#else
#define DBGP Noprint
int Noprint(char* fmt, ...);
#endif

#define printf Noprintf

// 10x10棋盘
#define M 10

// 驱逐舰 2格 destroyer
#define D 2

// 潜艇 3格 submarine
#define S 4

// 巡洋舰 3格 cruiser
#define C 8

// 战列舰 4格 battleship
#define B 16

// 航母 5格 aircraft carrier
#define A 32

typedef struct{
    int area[M][M];
}Battlefield;

extern FILE * logfile;

extern const char warships[34];
extern char * PlayerAName;
extern char * PlayerBName;
extern Battlefield PlayerA_BF;
extern Battlefield PlayerB_BF;

extern int Noprintf(char* fmt, ...);
extern void printBF(Battlefield * BF);
extern void printALL(Battlefield * ABF, Battlefield * BBF);
extern int isOver(Battlefield * BF);

#endif